/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Andre
 */
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Table(name = "aluno")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Aluno.findAll", query = "SELECT a FROM Aluno a"),
    @NamedQuery(name = "Aluno.findByDataInclusao", query = "SELECT a FROM Aluno a WHERE a.dataInclusao = :dataInclusao")})
public class Aluno extends Pessoa implements Serializable {
    
    private static long serialVersionUID = 1L;
    
    @Basic(optional = false)
    @NotNull
    @Column(name = "dataInclusao")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dataInclusao;
    
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "aluno")
    private List<Ficha> fichaList;
    
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "aluno")
    private List<Medida> medidaList;
    
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "aluno")
    private List<Matricula> matriculaList;

    public Aluno() {
    }

    public Aluno(Date dataInclusao) {
        this.dataInclusao = dataInclusao;
    }
    
    public Aluno(String nome, String cgc, String tipoPessoa, Date dataInclusao){
        super(nome, cgc, tipoPessoa);
        this.dataInclusao = dataInclusao;
    }

    public Date getDataInclusao() {
        return dataInclusao;
    }

    public void setDataInclusao(Date dataInclusao) {
        this.dataInclusao = dataInclusao;
    }

    @XmlTransient
    public List<Ficha> getFichaList() {
        return fichaList;
    }

    public void setFichaList(List<Ficha> fichaList) {
        this.setFichaList(fichaList);
    }

    @XmlTransient
    public List<Medida> getMedidaList() {
        return medidaList;
    }

    public void setMedidaList(List<Medida> medidaList) {
        this.setMedidaList(medidaList);
    }

    @XmlTransient
    public List<Matricula> getMatriculaList() {
        return matriculaList;
    }

    public void setMatriculaList(List<Matricula> matriculaList) {
        this.setMatriculaList(matriculaList);
    }
    
}
